Baseball, by the Rules

Manager Tory Lovullo, of the Airzona Diamondbacks, approaches the pitchers' mound to make a pitching change, while the entire Diamondbacks infield looks on.
Mound Visits
A mound visit refers to a conference on the pitching mound— usually between plate appearances, but sometimes between pitches in a single plate appearance— between the pitcher and a supporting cast that ranges from, at minimum, their catcher, all the way up to the entire infield, plus either a coach (usually the pitching coach) or the team’s manager.
There are a few reasons why you’ll see a mound visit, from figuring out how to handle a hitter, to making sure everyone in the infield is on the same page about the defensive strategy, to just simply giving a struggling pitcher a chance to catch their breath (or to allow a reliever more time to warm up so that they can replace the struggling pitcher). No matter the reason, though, mound visits all conform to the same few rules.
First, mound visits have a 30-second time limit on them, though this is a little bit of a softer limit, especially if no one from the dugout comes to join in. The home plate umpire will walk out to the mound to break up these visits, though there’s no set penalty for continuing to gab1. On a broader level, each team is granted four mound visits per game— though, if a team runs out by the ninth inning, they get an extra one, with additional visits added should the game go to extra innings. Because of this limit2, there are a lot of specifications as to what does and does not constitute a mound visit. For example, if the coaches/trainers need to come out and check a pitcher for injury, or if a player needs to run to the mound to clean their cleats, those won't count as mound visits. Once a coach or manager comes out of the dugout to talk strategy, that's a mound visit. Once a coach or manager has made a mound visit, if they go out to visit the same pitcher a second time during the same inning, that pitcher must be replaced. Otherwise, play continues.